home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntlib43 / mntlib / makefile < prev    next >
Makefile  |  1994-02-14  |  4KB  |  232 lines

  1. #
  2. # Top level Makefile for MiNT-Gcc library
  3. #
  4.  
  5. # GCC configuration info...
  6.  
  7. # Leave the next line undefined for native compilation setup.
  8. # CROSSDIR := /net/acae127/home/bammi/atari/cross-gcc
  9.  
  10. # Define MINTFLAG if you want to use the "normal"
  11. # gcc libraries, too
  12. # MINTFLAG := -mint
  13.  
  14. ifdef MINTFLAG
  15. MINTOPT := -mint
  16. else
  17. MINTOPT :=
  18. endif
  19.  
  20. ifdef CROSSDIR
  21.  
  22. # Set up to do cross-compiling...
  23.  
  24. CROSSLIB := $(CROSSDIR)/lib
  25. CROSSBIN := $(CROSSDIR)/bin
  26.  
  27. AR    := $(CROSSBIN)/car
  28. AS     := cgcc $(MINTOPT)
  29. CC    := cgcc $(MINTOPT)
  30. LIB     := $(CROSSLIB)
  31. VPATH   := ../co
  32. CP    := cp
  33.  
  34. else
  35.  
  36. # Set up to run native...
  37.  
  38. AR    := gcc-ar
  39. AS    := gcc $(MINTOPT)
  40. CC    := gcc $(MINTOPT)
  41. LIB    := c:\gnu\lib
  42. CP    := mv
  43.  
  44. endif
  45.  
  46. ifdef ENTROPY
  47. # This reflects my setup, your mileage may vary.
  48. ifndef CROSSDIR
  49. AR    := ar
  50. LIB    := /src/newlib
  51. INCLUDE_DIR := /usr/include
  52. else
  53. MINTFLAG := -mint
  54. MINTOPT := $(MINTFLAG)
  55. INCLUDE_DIR := ../minclude
  56. endif
  57. XPFLAGS :=  -nostdinc -I$(INCLUDE_DIR)
  58. XFLAGS := $(XPFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes
  59. endif
  60.  
  61. # Flags for extra 'long long' support under newer gcc's
  62. #LONGLONG=-DPRINTF_LONGLONG
  63.  
  64. # Flags for extra 'long double' support under newer gcc's
  65. #XFLOAT=-DXFLOAT_ENABLE
  66.  
  67. # Additional options for compiling C code
  68.  
  69. #XFLAGS := -I../co
  70.  
  71. # Dynamic selection of options for each target library...
  72.  
  73. ifneq (,$(findstring debug,$(TARGET)))
  74. OPTIM= -O -g -Wstrict-prototypes
  75. FRAME=
  76. DEBUG=
  77. g=g
  78. else
  79. OPTIM= -O2 -fstrength-reduce
  80. FRAME= -fomit-frame-pointer
  81. DEBUG= -DNDEBUG
  82. g=
  83. endif
  84.  
  85. ifneq (,$(findstring long-int,$(TARGET)))
  86. SHORT=
  87. DSHORT=
  88. ST=
  89. else
  90. SHORT= -mshort
  91. DSHORT= -DSHORTLIB
  92. ST=16
  93. endif
  94.  
  95. ifneq (,$(findstring 68020,$(TARGET)))
  96. CC := $(CC) -m68020 -m68881
  97. endif
  98.  
  99. ifneq (,$(findstring baserel,$(TARGET)))
  100. CC := $(CC) -mbaserel
  101. b=b
  102. else
  103. b=
  104. endif
  105.  
  106. ifneq (,$(findstring sfp004,$(TARGET)))
  107. SFPFLAG = -Dsfp004
  108. SFP=sfp
  109. else
  110. SFPFLAG=
  111. SFP=
  112. endif
  113.  
  114. # common subset of options; no int size or omit-frame-pointer:
  115. COPTS= $(DEBUG) $(OPTIM) $(XFLAGS) $(SFPFLAG)
  116.  
  117. # Base options CC; includes int size but not omit-frame-pointer
  118. CFFLAGS = $(SHORT) $(COPTS)
  119.  
  120. # normal CFLAGS including int size and omit-frame-pointer
  121. CFLAGS= $(CFFLAGS) $(FRAME) $(LONGLONG)
  122.  
  123. # cflags for stuff that needs to be compiled with 32 bit ints
  124. CLFLAGS= $(COPTS) $(FRAME) $(DSHORT) $(XFLOAT)
  125.  
  126. # flags to $(CC) when it runs the assembler only
  127. ASFLAGS= -c
  128.  
  129. # flags to $(CC) when running preprocessor and assembler
  130. PPFLAGS= $(XPFLAGS) $(SHORT) $(SFPFLAG) -P -c
  131.  
  132. # library targets
  133. ifdef MINTFLAG
  134.  
  135. CLIB= $bmint$g$(SFP)$(ST).olb
  136. CLIB020=$bmint$g$(SFP)$(ST)020.olb
  137. IIOLIB= $bmiio$g$(SFP)$(ST).olb
  138. CRT0=$bmcrt0.o
  139. GCRT0=$bmgcrt0.o
  140.  
  141. else
  142.  
  143. CLIB= $bgnu$g$(SFP)$(ST).olb
  144. CLIB020=$bgnu$g$(SFP)$(ST)020.olb
  145. IIOLIB= $biio$g$(SFP)$(ST).olb
  146. CRT0=$bcrt0.o
  147. GCRT0=$bgcrt0.o
  148.  
  149. endif
  150.  
  151. STARTO= $(CRT0) $(GCRT0)
  152.  
  153. # the stuff to make
  154. ALL= $(CLIB) $(IIOLIB) $(STARTO)
  155. ALL020 = $(CLIB020) $(STARTO)
  156.  
  157. #all: lshort llong lgshort lglong
  158. top: lshort llong lbshort lblong
  159. top020: l020short l020long l020bshort l020blong
  160.  
  161. %.target:
  162.     $(MAKE) clean
  163.     -rm -f *.target
  164.     -touch $@
  165.  
  166. lshort: lshort.target
  167.     $(MAKE) install
  168.  
  169. llong: llong.target
  170.     $(MAKE) install TARGET="long-int"
  171.  
  172. lgshort: lgshort.target
  173.     $(MAKE) install TARGET=debug
  174.  
  175. lglong: lglong.target
  176.     $(MAKE) install TARGET="long-int debug"
  177.  
  178. l020short: l020short.target
  179.     $(MAKE) install020 TARGET=68020
  180. #    $(MAKE) install TARGET=68020
  181.  
  182. l020long: l020long.target
  183.     $(MAKE) install020 TARGET="68020 long-int"
  184. #    $(MAKE) install TARGET="68020 long-int"
  185.  
  186. lbshort: lbshort.target
  187.     $(MAKE) install TARGET="baserel"
  188.  
  189. lblong: lblong.target
  190.     $(MAKE) install TARGET="long-int baserel"
  191.  
  192. l020bshort: l020bshort.target
  193.     $(MAKE) install020 TARGET="68020 baserel"
  194.  
  195. l020blong: l020blong.target
  196.     $(MAKE) install020 TARGET="68020 long-int baserel"
  197.  
  198. lsfpshort: lsfpshort.target
  199.     $(MAKE) install TARGET="sfp004"
  200.  
  201. lsfplong: lsfplong.target
  202.     $(MAKE) install TARGET="long-int sfp004"
  203.  
  204. lbsfpshort: lbsfpshort.target
  205.     $(MAKE) install TARGET="baserel sfp004"
  206.  
  207. lbsfplong: lbsfplong.target
  208.     $(MAKE) install TARGET="long-int baserel sfp004"
  209.  
  210. bakclean:
  211.     rm -f *~ *#
  212.     rm -f */*~ */*#
  213.     rm -f *.orig *.rej
  214.     rm -f */*.orig */*.rej
  215.     rm -f $(INCLUDE_DIR)/*~ $(INCLUDE_DIR)/*#
  216.     rm -f $(INCLUDE_DIR)/*/*~ $(INCLUDE_DIR)/*/*#
  217.     rm -f $(INCLUDE_DIR)/*.orig $(INCLUDE_DIR)/*.rej
  218.     rm -f $(INCLUDE_DIR)/*/*.orig $(INCLUDE_DIR)/*/*.rej
  219.  
  220. realclean: bakclean
  221.     rm -f *.o *.olb *.tmp
  222.     rm -f core report nohup.out
  223.     rm -f foo bar baz
  224.     rm -f *.target
  225.  
  226. distclean: realclean
  227.     rm -f diffc diffh
  228.  
  229. # Get the rules to build everything...
  230.  
  231. include mincl
  232.